package jiakuang2;
import java.util.HashMap;
import java.util.Map;
public class study3 {
    private String name;
    private int age;
//无参构造方法
    public study3(){

    }
    //有参构造方法
    public study3(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        //创建数据
        study3 th=new study3("朱玉",12);
        study3 th1=new study3("玉竹",13);
        study3 th2=new study3("周一",14);
        study3 th3=new study3("朱玉",12);
        //创建集合
        Map study3=new HashMap();
        //添加数据
        study3.put("朱玉",12);
        study3.put("玉竹",13);
        study3.put("周一",14);
        study3.put("朱玉",12);
        //遍历
        for(Object people:study3.values()){
            System.out.println(people);
        }
    }
}
